package com.example.customview.view

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import com.example.customview.R
import com.sample.base.utils.dp

class CircleAnimatorView(context: Context?, attrs: AttributeSet?) : View(context, attrs) {

    var radius = 66.dp.toFloat()
        set(value) {
            field = value
            invalidate()
        }

    @SuppressLint("NewApi")
    private val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
        color = resources.getColor(R.color.colorJINLIANHUACHENG, resources.newTheme())
    }

    override fun onDraw(canvas: Canvas) {
        canvas.drawCircle(
            width / 2f, height / 2f
            , radius, paint
        )

    }
}